package bufferedreader;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created by 5406160@qq.com on LiBoWen 李博闻.
 *
 * @ClassName : BufferedReaderDemo
 * @Author : 54061
 * @Date: 2022/2/14 11:07
 */
public class BufferedReaderDemo {
    public static void main(String[] args) throws IOException {
        //创建输入流对象
        BufferedReader br = new BufferedReader(new FileReader(""));
        //定义一个String变量line 用来接收每次读到的一行数据
        String line;
        //循环读
        while ((line = br.readLine()) != null) {
            //line不为null说明读到了 读到了就可以输出 -> 输出记得加换房
            System.out.println(line);


        }
        //关流
        br.close();

    }

    public static void method(BufferedReader br) throws IOException, IOException {
        //String readLine()
        String line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        line = br.readLine();
        System.out.println(line);

        System.out.println(br.readLine());//null
        System.out.println(br.readLine());
        System.out.println(br.readLine());
        System.out.println(br.readLine());
        System.out.println(br.readLine());
    }
}
